<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <style>
        .flex-container {
            display: flex;
            flex-direction: row;
            width: 200px;
            border: 1px solid #000;
        }

        .flex-item {
            flex: 0 0 50px;
            height: 50px;
            margin: 5px;
            background-color: #999;
            color: #fff;
            text-align: center;
            line-height: 50px;
            border: 1px solid #666;
        }

        .nowrap {
            flex-wrap: nowrap;
        }

        .wrap {
            flex-wrap: wrap;
        }

        .wrap-reverse {
            flex-wrap: wrap-reverse;
        }
    </style>
</head>

<body>
    <h2>nowrap (默认)</h2>
    <div class="flex-container nowrap">
        <div class="flex-item">1</div>
        <div class="flex-item">2</div>
        <div class="flex-item">3</div>
        <div class="flex-item">4</div>
        <div class="flex-item">5</div>
    </div>

    <h2>wrap</h2>
    <div class="flex-container wrap">
        <div class="flex-item">1</div>
        <div class="flex-item">2</div>
        <div class="flex-item">3</div>
        <div class="flex-item">4</div>
        <div class="flex-item">5</div>
    </div>

    <h2>wrap-reverse</h2>
    <div class="flex-container wrap-reverse">
        <div class="flex-item">1</div>
        <div class="flex-item">2</div>
        <div class="flex-item">3</div>
        <div class="flex-item">4</div>
        <div class="flex-item">5</div>
    </div>
</body>

</html>